using System.Data.Entity.ModelConfiguration;

namespace EfSessionStateProvider
{
    public class ASPStateTempSessionMap : EntityTypeConfiguration<ASPStateTempSession>
    {
        public ASPStateTempSessionMap()
        {
            this.HasKey(o => new { o.ApplicationName, o.SessionId });

            this.Property(t => t.ApplicationName)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(280);

            this.Property(t => t.SessionId)
                .IsRequired()
                .HasMaxLength(88);

            this.Property(t => t.SessionId);
            this.Property(t => t.Created);
            this.Property(t => t.Expires);
            this.Property(t => t.LockDate);
            this.Property(t => t.LockId);
            this.Property(t => t.Timeout);
            this.Property(t => t.Locked);
            this.Property(t => t.SessionItems);
            this.Property(t => t.Flags);
        }
    }
}